<template>
  <div >
    <span>基础折线图</span>
  </div>
  <div id="basicLine" class="chart-win"></div>
</template>
<script>
import echarts from "echarts";
import { onMounted } from "vue";
export default {
  
  setup() {
    let option = {
      xAxis: {
        type: "category",
        data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
      },
      yAxis: {
        type: "value",
      },
      series: [
        {
          data: [820, 932, 901, 934, 1290, 1330, 1320],
          type: "line",
        },
      ],
    };

    onMounted(() => {
      drawChart();
    });

    const drawChart = () => {
      let elementById = document.getElementById("basicLine");
      let lineChart = echarts.init(elementById);
      lineChart.setOption(option);
    };

    return {};
  },
};
</script>
<style scoped >


    .chart-win {
        width: 500px;
        height: 500px;

}
</style>